package com.red.star.macalline.data.mappers;


import com.red.star.macalline.data.core.base.MyMapper;
import com.red.star.macalline.data.entity.Fans;
import com.red.star.macalline.data.entity.Mall;
import com.red.star.macalline.data.entity.MallExpand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Yenan
 * @Description:
 * @Date: Created in 18:19 2018/1/31
 */
public interface MallMapper extends MyMapper<Mall> {

    void updateByMallCode(Mall mall);

    void updateById(Mall mall);

    List<Mall> findAllBRegionCodeAndBRegionName();

    List<Mall> findAllSRegionCodeAndSRegionName();

    public Mall getMallByMallCode(String mallCode);

    public List<Mall> findMallList();

    public List<Mall> findMallListByMallCode(@Param("mallCode") String mallCode);

    public List<Mall> findMalls(@Param("mallCode") String mallCode);

    public List<Mall> findMalls();

    public List<Mall> findBRegionName(@Param("mallCode") String mallCode);

    public List<Mall> findSRegionName(@Param("mallCode") String mallCode);

    List<Mall> findMallsByParam(String mallCode);

    List<Mall> findAllMallName();

    List<Mall> findAllSmArea(@Param("bRegionCode") String bRegionCode);

    List<Mall> findAllMallNameArea(@Param("sRegionCode") String sRegionCode);

    Mall findMallByFansAndStoredCard(Fans fans);

    @Select(value = "select DISTINCT t.city from t_mall t where t.city is not null")
    public List<String> findCityName();

    public MallExpand findWelcomeById(@Param("id") Integer id);

    public List<Mall> findBRegionByMallCode(@Param("mallCode") String mallCode);

    public List<Mall> findSRegionByMallCode(@Param("mallCode") String mallCode);

    public List<Mall> findMallsByMallCode(@Param("mallCode") String mallCode);

    public List<String> findCityNameByMallCode(@Param("mallCode") String mallCode);

    public List<Mall> findBRegionCodeAndBRegionName();

    public List<Mall> findBigArea(@Param("mallCode") String mallCode);

    @Select(value = "select * from t_mall where oms_code=#{omsCode}")
    Mall findMallByOmsCode(@Param("omsCode") String omsCode);

    Mall findMallByFansAndStoredCardOther(Fans fans);
}
